.class public Lcom/melesta/engine/Renderer;
.super Ljava/lang/Object;
.source "Renderer.java"

# interfaces
.implements Landroid/opengl/GLSurfaceView$Renderer;


# instance fields
.field private mReinit:I

.field private mScreenHeight:I

.field private mScreenWidth:I


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 9
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method private static native nativeDeleteBackward()V
.end method

.method private static native nativeGetContentText()Ljava/lang/String;
.end method

.method private static native nativeInit(II)V
.end method

.method private static native nativeInsertText(Ljava/lang/String;)V
.end method

.method private static native nativeKeyDown(I)Z
.end method

.method private static native nativeKeyUp(I)Z
.end method

.method private static native nativeOnPause()V
.end method

.method private static native nativeOnResume()V
.end method

.method private static native nativeReloadProfile()V
.end method

.method private static native nativeRender()V
.end method

.method private static native nativeSetRotation(I)V
.end method

.method private static native nativeTouchesBegin(IFF)V
.end method

.method private static native nativeTouchesCancel([I[F[F)V
.end method

.method private static native nativeTouchesEnd(IFF)V
.end method

.method private static native nativeTouchesMove([I[F[F)V
.end method


# virtual methods
.method public getContentText()Ljava/lang/String;
    .locals 1

    .prologue
    .line 131
    invoke-static {}, Lcom/melesta/engine/Renderer;->nativeGetContentText()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public handleActionCancel([I[F[F)V
    .locals 0
    .parameter "pIDs"
    .parameter "pXs"
    .parameter "pYs"

    .prologue
    .line 82
    invoke-static {p1, p2, p3}, Lcom/melesta/engine/Renderer;->nativeTouchesCancel([I[F[F)V

    .line 83
    return-void
.end method

.method public handleActionDown(IFF)V
    .locals 0
    .parameter "pID"
    .parameter "pX"
    .parameter "pY"

    .prologue
    .line 74
    invoke-static {p1, p2, p3}, Lcom/melesta/engine/Renderer;->nativeTouchesBegin(IFF)V

    .line 75
    return-void
.end method

.method public handleActionMove([I[F[F)V
    .locals 0
    .parameter "pIDs"
    .parameter "pXs"
    .parameter "pYs"

    .prologue
    .line 86
    invoke-static {p1, p2, p3}, Lcom/melesta/engine/Renderer;->nativeTouchesMove([I[F[F)V

    .line 87
    return-void
.end method

.method public handleActionUp(IFF)V
    .locals 0
    .parameter "pID"
    .parameter "pX"
    .parameter "pY"

    .prologue
    .line 78
    invoke-static {p1, p2, p3}, Lcom/melesta/engine/Renderer;->nativeTouchesEnd(IFF)V

    .line 79
    return-void
.end method

.method public handleDeleteBackward()V
    .locals 0

    .prologue
    .line 127
    invoke-static {}, Lcom/melesta/engine/Renderer;->nativeDeleteBackward()V

    .line 128
    return-void
.end method

.method public handleInsertText(Ljava/lang/String;)V
    .locals 2
    .parameter "pText"

    .prologue
    .line 120
    const-string v0, "\n"

    invoke-virtual {p1, v0}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 121
    const/4 v0, 0x0

    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v1

    add-int/lit8 v1, v1, -0x1

    invoke-virtual {p1, v0, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object p1

    .line 123
    :cond_0
    invoke-static {p1}, Lcom/melesta/engine/Renderer;->nativeInsertText(Ljava/lang/String;)V

    .line 124
    return-void
.end method

.method public handleKeyDown(ILandroid/view/KeyEvent;)V
    .locals 1
    .parameter "pKeyCode"
    .parameter "pKeyEvent"

    .prologue
    .line 90
    invoke-virtual {p2}, Landroid/view/KeyEvent;->getAction()I

    move-result v0

    .line 91
    .local v0, action:I
    packed-switch v0, :pswitch_data_0

    .line 100
    :goto_0
    return-void

    .line 93
    :pswitch_0
    invoke-static {p1}, Lcom/melesta/engine/Renderer;->nativeKeyDown(I)Z

    goto :goto_0

    .line 97
    :pswitch_1
    invoke-static {p1}, Lcom/melesta/engine/Renderer;->nativeKeyUp(I)Z

    goto :goto_0

    .line 91
    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method

.method public handleOnPause()V
    .locals 0

    .prologue
    .line 103
    invoke-static {}, Lcom/melesta/engine/Renderer;->nativeOnPause()V

    .line 104
    return-void
.end method

.method public handleOnResume()V
    .locals 0

    .prologue
    .line 107
    invoke-static {}, Lcom/melesta/engine/Renderer;->nativeOnResume()V

    .line 108
    return-void
.end method

.method public onDrawFrame(Ljavax/microedition/khronos/opengles/GL10;)V
    .locals 2
    .parameter "gl"

    .prologue
    .line 29
    iget v0, p0, Lcom/melesta/engine/Renderer;->mReinit:I

    if-lez v0, :cond_0

    .line 30
    iget v0, p0, Lcom/melesta/engine/Renderer;->mReinit:I

    add-int/lit8 v0, v0, -0x1

    iput v0, p0, Lcom/melesta/engine/Renderer;->mReinit:I

    .line 50
    :goto_0
    return-void

    .line 34
    :cond_0
    invoke-static {}, Lcom/melesta/engine/EngineActivity;->fireBeginTick()V

    .line 38
    iget v0, p0, Lcom/melesta/engine/Renderer;->mReinit:I

    if-nez v0, :cond_1

    .line 40
    iget v0, p0, Lcom/melesta/engine/Renderer;->mReinit:I

    add-int/lit8 v0, v0, -0x1

    iput v0, p0, Lcom/melesta/engine/Renderer;->mReinit:I

    .line 41
    iget v0, p0, Lcom/melesta/engine/Renderer;->mScreenWidth:I

    iget v1, p0, Lcom/melesta/engine/Renderer;->mScreenHeight:I

    invoke-static {v0, v1}, Lcom/melesta/engine/Renderer;->nativeInit(II)V

    .line 44
    :cond_1
    invoke-static {}, Lcom/melesta/engine/Renderer;->nativeRender()V

    .line 46
    invoke-static {}, Lcom/melesta/engine/EngineActivity;->fireEndTick()V

    goto :goto_0
.end method

.method public onSurfaceChanged(Ljavax/microedition/khronos/opengles/GL10;II)V
    .locals 5
    .parameter "pGL10"
    .parameter "width"
    .parameter "height"

    .prologue
    .line 23
    const-string v0, "engine"

    const-string v1, "onSurfaceChanged(%d, %d)"

    const/4 v2, 0x2

    new-array v2, v2, [Ljava/lang/Object;

    const/4 v3, 0x0

    invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    aput-object v4, v2, v3

    const/4 v3, 0x1

    invoke-static {p3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    aput-object v4, v2, v3

    invoke-static {v1, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/melesta/engine/Log;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 24
    iget v0, p0, Lcom/melesta/engine/Renderer;->mReinit:I

    add-int/lit8 v0, v0, 0x4

    iput v0, p0, Lcom/melesta/engine/Renderer;->mReinit:I

    .line 25
    return-void
.end method

.method public onSurfaceCreated(Ljavax/microedition/khronos/opengles/GL10;Ljavax/microedition/khronos/egl/EGLConfig;)V
    .locals 5
    .parameter "pGL10"
    .parameter "pEGLConfig"

    .prologue
    .line 12
    const-string v0, "engine"

    const-string v1, "onSurfaceCreated(%s)"

    const/4 v2, 0x1

    new-array v2, v2, [Ljava/lang/Object;

    const/4 v3, 0x0

    invoke-virtual {p2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v4

    aput-object v4, v2, v3

    invoke-static {v1, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/melesta/engine/Log;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 13
    iget v0, p0, Lcom/melesta/engine/Renderer;->mScreenWidth:I

    iget v1, p0, Lcom/melesta/engine/Renderer;->mScreenHeight:I

    invoke-static {v0, v1}, Lcom/melesta/engine/Renderer;->nativeInit(II)V

    .line 14
    return-void
.end method

.method public reloadProfile()V
    .locals 0

    .prologue
    .line 111
    invoke-static {}, Lcom/melesta/engine/Renderer;->nativeReloadProfile()V

    .line 112
    return-void
.end method

.method public setRotation(I)V
    .locals 0
    .parameter "rotation"

    .prologue
    .line 135
    invoke-static {p1}, Lcom/melesta/engine/Renderer;->nativeSetRotation(I)V

    .line 136
    return-void
.end method

.method public setScreenWidthAndHeight(II)V
    .locals 0
    .parameter "pSurfaceWidth"
    .parameter "pSurfaceHeight"

    .prologue
    .line 53
    iput p1, p0, Lcom/melesta/engine/Renderer;->mScreenWidth:I

    .line 54
    iput p2, p0, Lcom/melesta/engine/Renderer;->mScreenHeight:I

    .line 55
    return-void
.end method
